<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditMaterialTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditMaterialLabel_idMaterial}" for="idMaterial" />
                    <h:inputText id="idMaterial" value="#{materialController.selected.idMaterial}" title="#{bundle.EditMaterialTitle_idMaterial}" required="true" requiredMessage="#{bundle.EditMaterialRequiredMessage_idMaterial}"/>
                    <h:outputLabel value="#{bundle.EditMaterialLabel_descricaoMaterial}" for="descricaoMaterial" />
                    <h:inputText id="descricaoMaterial" value="#{materialController.selected.descricaoMaterial}" title="#{bundle.EditMaterialTitle_descricaoMaterial}" required="true" requiredMessage="#{bundle.EditMaterialRequiredMessage_descricaoMaterial}"/>
                    <h:outputLabel value="#{bundle.EditMaterialLabel_peso}" for="peso" />
                    <h:inputText id="peso" value="#{materialController.selected.peso}" title="#{bundle.EditMaterialTitle_peso}" required="true" requiredMessage="#{bundle.EditMaterialRequiredMessage_peso}"/>
                    <h:outputLabel value="#{bundle.EditMaterialLabel_unidade}" for="unidade" />
                    <h:inputText id="unidade" value="#{materialController.selected.unidade}" title="#{bundle.EditMaterialTitle_unidade}" required="true" requiredMessage="#{bundle.EditMaterialRequiredMessage_unidade}"/>
                </h:panelGrid>
                <h:commandLink action="#{materialController.update}" value="#{bundle.EditMaterialSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditMaterialViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{materialController.prepareList}" value="#{bundle.EditMaterialShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditMaterialIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
